﻿using System;
using System.Collections.Generic;
using System.IO;
using Windows.UI.Xaml.Media.Imaging;
using System.Linq;
using System.Windows.Input;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.Devices.Input;
using Windows.UI.Core;
using System.Threading;
using System.Collections.Concurrent;

namespace RoboRun
{
    class loadingRobotSprite
    {
        public static void loadRobotInCorrectDirection3x3(String RobotStartingDirection, Image RobotSprite)
        {
            //Change source of image. 
            //If not good, we can always load one sprite and rotate accordingly. We'll see how it goes...
            if (RobotStartingDirection.Equals("North"))
            {
                RobotSprite.Source = new BitmapImage(new Uri("ms-appx:///Assets/GameplayScreen/3X3Grid/robotnorth.png", UriKind.Absolute
                   ));
            }
            else if (RobotStartingDirection.Equals("West"))
            {
                RobotSprite.Source = new BitmapImage(new Uri("ms-appx:///Assets/GameplayScreen/3X3Grid/robotwest.png", UriKind.Absolute
                  ));
            }
            else if (RobotStartingDirection.Equals("South"))
            {
                RobotSprite.Source = new BitmapImage(new Uri("ms-appx:///Assets/GameplayScreen/3X3Grid/robotsouth.png", UriKind.Absolute
                  ));
            }
            else if (RobotStartingDirection.Equals("East"))
            {
                RobotSprite.Source = new BitmapImage(new Uri("ms-appx:///Assets/GameplayScreen/3X3Grid/roboteast.png", UriKind.Absolute
                  ));
            }
        }

        public static void loadRobotInCorrectDirection4x4(String RobotStartingDirection, Image RobotSprite)
        {
            //Change source of image. 
            //If not good, we can always load one sprite and rotate accordingly. We'll see how it goes...
            if (RobotStartingDirection.Equals("North"))
            {
                RobotSprite.Source = new BitmapImage(new Uri("ms-appx:///Assets/GameplayScreen/4X4Grid/robotnorth.png", UriKind.Absolute
                   ));
            }
            else if (RobotStartingDirection.Equals("West"))
            {
                RobotSprite.Source = new BitmapImage(new Uri("ms-appx:///Assets/GameplayScreen/4X4Grid/robotwest.png", UriKind.Absolute
                  ));
            }
            else if (RobotStartingDirection.Equals("South"))
            {
                RobotSprite.Source = new BitmapImage(new Uri("ms-appx:///Assets/GameplayScreen/4X4Grid/robotsouth.png", UriKind.Absolute
                  ));
            }
            else if (RobotStartingDirection.Equals("East"))
            {
                RobotSprite.Source = new BitmapImage(new Uri("ms-appx:///Assets/GameplayScreen/4X4Grid/roboteast.png", UriKind.Absolute
                  ));
            }
        }
    }
    
}
